<fieldset>
    <legend>子选票单</legend>
  <div class="field">
    <%#= f.label :name %><br />
    <%#= f.text_field :name %>
    子选单名称：  <%= text_field_tag "vote[sections_attributes][][control_groups_attributes][][name]"  %>
  </div>

  <div class="field forvote selectcandidate">
    选择候选人：
    <%= select_tag "vote[sections_attributes][][control_groups_attributes][][candidate_ids][]",  options_for_select(@candidates.collect {|p| [ p.org.fullname.to_s+" "+p.name, p.id ] }), :multiple => true %>
  </div>
  <div class="field forvote maxcandidate">
    <%#= f.label :max %><br />
    <%#= f.number_field :max %>
    共有<span class="countcandidate">0</span>人，选出<%= number_field_tag "vote[sections_attributes][][control_groups_attributes][][max]",nil,:min=>0  %>人
  </div>
  <div class="field forvote mincandidate">
    <%#= f.label :min %><br />
    <%#= f.number_field :min %>
    最少选出<%= number_field_tag "vote[sections_attributes][][control_groups_attributes][][min]",0,:min=>0  %>人
  </div>

  <div class="field formark">
    选择评价指标：
    <%= select_tag "vote[sections_attributes][][control_groups_attributes][][question_ids][]", options_from_collection_for_select(@questions, "id", "text" ), :multiple => true %>
    选择参与评价的单位：
    <%= select_tag "vote[sections_attributes][][control_groups_attributes][][org_ids][]", options_from_collection_for_select(@orgs, "id", "fullname", @orgs.collect{ |l| l.id }), :multiple => true %>
  </div>


  <div class="field">
  <%#= link_to_remove_fields "remove control group", f%>
  <%#= f.hidden_field :_destroy %>  
  <%#= link_to_function "remove", "remove_fields(this)" %> 
  <%#= f.check_box :_destroy %>  
  <%#= f.label :_destroy, "Remove Control Group" %>  
  </div>

<%= link_to_function("删除本子选票单", "remove_field(this)")%>
</fieldset> 
